import {createRouter, createWebHistory, createWebHashHistory} from 'vue-router'
import Layout from "../layout/Index.vue"

const router = createRouter({
    // history: createWebHistory(import.meta.env.BASE_URL),
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            component: Layout,
            redirect: '/dashboard',
            children: [
                {
                    path: 'dashboard',
                    component: () => import('../views/dsahboard/Index.vue'),
                    name: 'Dashboard',
                    meta: {title: 'Dashboard', icon: 'dashboard', affix: true, transition: 'slide-left'}
                }
            ]
        },
        {
            path: '/login',
            component: () => import('../views/login/Index.vue'),
        },
        {
            path: '/user',
            component: Layout,
            children: [
                {
                    path: 'index',
                    component: () => import('../views/user/Index.vue'),
                    name: 'user',
                    meta: {title: 'user', icon: 'user', affix: true, transition: 'slide-left'}
                }
            ]
        },
        {
            path: '/permission',
            component: Layout,
            children: [
                {
                    path: 'index',
                    component: () => import('../views/permission/Index.vue'),
                    name: 'permission',
                    meta: {title: 'permission', icon: 'permission', affix: true, transition: 'slide-left'}
                }
            ]
        },
        {
            path: '/settings',
            component: Layout,
            children: [
                {
                    path: 'index',
                    component: () => import('../views/settings/Index.vue'),
                    name: 'settings',
                    meta: {title: 'settings', icon: 'settings', affix: true, transition: 'slide-left'}
                }
            ]
        },
        {
            path: '/datadictionary',
            component: Layout,
            children: [
                {
                    path: '/datadictionary',
                    component: () => import('../views/DataDictionary/Index.vue'),
                    name: 'datadictionary',
                    meta: {title: 'datadictionary', icon: 'datadictionary', affix: true}
                }
            ]
        },
        {
            path: '/usercenter',
            component: Layout,
            children: [
                {
                    path: '/usercenter',
                    component: () => import('../views/UserCenter/Index.vue'),
                    name: 'usercenter',
                    meta: {title: 'usercenter', icon: 'usercenter', affix: true}
                }
            ]
        }
    ]
})

export default router
